package com.goldsign.pay.common.to;

import java.util.HashMap;
import java.util.Map;

/**
* @ClassName: ServiceResponse
* @Description: 
* @author: huguang
* @date: 2015-12-14 下午12:33:58
*
*/
public class ServiceResponseDTO<T> {
    private String resp_code;
    private String resp_msg;
    private T result_data;//正常情况下返回的数据封装成json
    private String sign;

    public ServiceResponseDTO(){

    }

    public ServiceResponseDTO(String resp_code){
        this.resp_code=resp_code;

    }

    public ServiceResponseDTO(String resp_code,String resp_msg){
        this.resp_code=resp_code;
        this.resp_msg=resp_msg;
    }

    public String getResp_code() {
        return resp_code;
    }

    public void setResp_code(String resp_code) {
        this.resp_code = resp_code;
    }

    public String getResp_msg() {
        return resp_msg;
    }

    public void setResp_msg(String resp_msg) {
        this.resp_msg = resp_msg;
    }

    public T getResult_data() {
        return result_data;
    }

    public void setResult_data(T result_data) {
        this.result_data = result_data;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public void putEntry(String key, Object obj){
        HashMap<String,Object> hashMap = new HashMap<String,Object>();
        hashMap.put(key, obj);
        this.result_data=(T)hashMap;

    }

    @Override
    public String toString() {
        return "ServiceResponseDTO{" +
                "resp_code='" + resp_code + '\'' +
                ", resp_msg='" + resp_msg + '\'' +
                ", result_data=" + result_data +
                ", sign='" + sign + '\'' +
                '}';
    }
}
